import {Component, OnInit} from '@angular/core';
import {Observable} from "rxjs";
import {ApiService} from "../shared/api.service";

@Component({
  selector: 'app-admin3',
  template: `
    <p class="alert alert-danger">
      This is the <strong>🔧 ADMIN 3</strong> component.
      It will redirect you to login if needed.
      - {{ apiResponse | async }}
    </p>
  `,
  styles: [
  ]
})

export class Admin3Component implements OnInit {
  apiResponse!: Observable<string>;

  constructor(private apiService: ApiService) { }

  ngOnInit(): void {
    this.apiResponse = this.apiService.getProtectedApiResponse();
  }

}
